#import <UIKit/UIKit.h>

#define LABEL_AUTOSIZE			(1)

#define	INFOTEXT		@"text"
#define	INFOFONT		@"font"
#define	INFOCOLOR		@"color"
#define	INFOIMAGE		@"image"

/*===================================================================
 说明：
	当文本为数字时，指定保留的小数零位
 ==================================================================*/
typedef NS_ENUM(NSInteger, MRLabelKeepZero) {
	MRLabelKeepZeroFree		,
	MRLabelKeepZero0		,
	MRLabelKeepZero1		,
	MRLabelKeepZero2		,
	MRLabelKeepZero3		,
	MRLabelKeepZero4		,
};

/*===================================================================
 说明：
    带后缀单位的标签
 ==================================================================*/
@interface MRLabel : UILabel
{
	NSTimer		*_tmrInfo;
	NSInteger	_idxInfo;
}

@property (nonatomic, copy) NSString		*formatText;	//格式化文本

@property (nonatomic, copy)	NSString		*string;
@property (nonatomic, retain) UIFont		*stringFont;    //后缀字体
@property (nonatomic, retain) UIColor		*stringColor;   //后缀颜色

@property (nonatomic, retain) UIImage		*image;			//后缀图像
@property (nonatomic, retain) UIImage		*head;			//前缀图像

@property (nonatomic, assign) UIEdgeInsets	contentInset;

@property (nonatomic, assign) CGFloat		space;          //后缀与字符空间，默认4
@property (nonatomic, assign) CGFloat		scale;          //后缀缩放大小，默认1， 字符时*0.6

@property (nonatomic, assign) NSInteger		autoWidth;      //自动宽度，默认0， 0:正常 <0:最小宽度(绝对值、实际大于最小时为实际宽度) >0:步进宽度(按实际宽度整倍于此值)
@property (nonatomic, assign) MRLabelKeepZero	keepZero;	//是否清除最后的“0”，仅数字并且是小数时有效, 值为保留小数点位数

//
@property (nonatomic, retain) NSArray <NSDictionary *>	*texts;

@property (nonatomic, readonly) NSLayoutConstraint		*width, *left, *right;

@end
